package com.webmeeting.jsfbeans.chat.wordchat;

import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import com.webmeeting.chat.wordchat.bl.ChatRoom;
import com.webmeeting.chat.wordchat.servlets.WordChatInitServlet;

@ManagedBean(name = "roomListBean_wordchat")
@RequestScoped
public class RoomListBean {

	// All the rooms in the application
	private List<ChatRoom>	rooms;
	
	public String gotoCreateRoom(String contextPath) {
		return contextPath + "/chat/wordchat/createRoom.xhtml";
	}

	public List<ChatRoom> getRooms() {
		this.rooms = WordChatInitServlet.getOnlineRoomList();
		return rooms;
	}

	public void setRooms(List<ChatRoom> rooms) {
		this.rooms = rooms;
	}

}
